package com.wodsy.phoenix.dataobject.shoppingcart.model;

// Generated 2015-5-15 14:59:21 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.wodsy.phoenix.dataobject.base.PhoenixObject;

/**
 * TbShoppingcartItemExt generated by hbm2java
 */
@Entity
@Table(name = "tb_shoppingcart_item_ext", catalog = "shoppingcartc")
public class ShoppingcartItemExt extends PhoenixObject {

	private Integer id;
	//private long cartItemId;
	private String sellerUserName;
	private String shopName;
	private Date createTime;
	private Date updateTime;
	
	private ShoppingcartItem shoppingcartItem;
	
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="cartItemId")
	public ShoppingcartItem getShoppingcartItem() {
		return shoppingcartItem;
	}

	public void setShoppingcartItem(ShoppingcartItem shoppingcartItem) {
		this.shoppingcartItem = shoppingcartItem;
	}

	public ShoppingcartItemExt() {
	}

	public ShoppingcartItemExt( String sellerUserName,
			String shopName, Date createTime) {
		this.sellerUserName = sellerUserName;
		this.shopName = shopName;
		this.createTime = createTime;
	}

	public ShoppingcartItemExt(String sellerUserName,
			String shopName, Date createTime, Date updateTime) {
		this.sellerUserName = sellerUserName;
		this.shopName = shopName;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "seller_user_name", nullable = false, length = 30)
	public String getSellerUserName() {
		return this.sellerUserName;
	}

	public void setSellerUserName(String sellerUserName) {
		this.sellerUserName = sellerUserName;
	}

	@Column(name = "shop_name", nullable = false, length = 30)
	public String getShopName() {
		return this.shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Override
	public String toString() {
		return "ShoppingcartItemExt [id=" + id + ", sellerUserName="
				+ sellerUserName + ", shopName=" + shopName + ", createTime="
				+ createTime + ", updateTime=" + updateTime + "]";
	}
	
	

}
